<template>
<!-- <div style="width:1500px"> -->
  <el-container >
            <el-col :span="4" v-for="(item,index) of Monitor" :key="index" style="margin-left: 20px">
              <device-status  v-bind:dataList="Monitor[index]"></device-status>
            </el-col>
            </el-container>
<!-- </div> -->
</template>

<script>
import DeviceStatus from "@/components/MyDeviceCompone/DeviceStatus";
import {getSensorGroupList} from "@/views/overviews/menu.js";
export default {
name:"DevMonitor",
components: {DeviceStatus},
data() {
        return {
          params:{
            id:'',
          },
          value1:[{
          name:"LED电流",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:0
        },{
          name:"A相B相",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:1
        },{
          name:"B相C相",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:2
        },{
          name:"D相C相",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:0
        },{
          name:"LED电流",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:1
        },{
          name:"LED电流",
          data:{"LED电流":"12mA","半导体制冷器温度":"67℃","调制器驱动电压":"45V","输入电压峰值":"12V","输入电压平均偏离差":"78",
          "二次谐波电压":"89mA","一次电流":"122A"},
           state:2
        }],
        Monitor:'',
        }
},
watch: {
    "$route.params": {
       handler(new_value, old_value) {
           console.log("新值dd",new_value.id)
           this.params.id = new_value.id;
           console.log(this.value1)
           getSensorGroupList(this.params.id).then(res=>{
            this.Monitor= res.data;
            console.log(this.Monitor)
          })
       },
    }
  },
  methods:{
    getSensorGroupData(id){
      getSensorGroupList(id).then(res=>{
        this.value1 = res
        console.log(value1)
      })
    }
    },

    created() {
      console.log("路由",this.$route.params.id)
        getSensorGroupList(this.$route.params.id).then(response => {
               this.adminMenu=response.data   
        })
    },
   
}

</script>

<style>

</style>
